{include file="public/header" /}

<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-body">
            <fieldset id="searchFieldset_currentTableRenderId" class="table-search-fieldset">
              <legend>条件搜索</legend>
              <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">类型</label>
                  <div class="layui-input-inline">
                    <select name="type">
                      <option value="">选择类型</option>
                      {foreach $typepeople as $k => $v}
                      <option value="{$k}" {if !empty(input('get.type')) && input('get.type')==$k}selected{/if}>
                        {$v|default=''}</option>
                      {/foreach}
                    </select>
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">关键字</label>
                  <div class="layui-input-inline">
                    <input type="text" name="title" placeholder="搜索账号|备注" value="{:input('get.title')}"
                      autocomplete="off" class="layui-input" />
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <input type="hidden" name="sorts" value="{:input('get.sorts')}" class="layui-input" />
                  <input type="hidden" name="ustatus" value="{:input('get.ustatus')}" class="layui-input" />
                  <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
                    搜索
                  </button>
                </div>
              </form>
            </fieldset>
          </div>
          <div class="layui-card-body layui-row layui-col-space10">
            共有数据：<strong id="count">{$list->total()}</strong> 条
          </div>
          <div class="layui-table-body layui-table-main">
            <table class="layui-table">
              <thead>
                <tr>
                  <th>
                    <div class="layui-table-cell">ID</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">类型</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">账号</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">组别</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">联系电话</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">备注</div>
                  </th>
                  <th>
                    <div class="layui-table-cell">操作</div>
                  </th>
                </tr>
              </thead>
              <tbody>
                {foreach $list as $v}
                <tr>
                  <td>
                    <div class="layui-table-cell">{$v.id}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.type_text}{if $v.type == 3}{if $v.sonstype == 1 }[经理]{/if}{if
                      $v.sonstype == 2 }[助理]{/if}{/if}{if $v.type == 2}{if $v.sonstype == 1 }[督导]{/if}{if
                      $v.sonstype == 2 }[专员]{/if}{/if}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.account}(附近店铺可见{$v.km|default="0"}km)
                      {if $v.type == 2} {if $v.httext == 1}[寄待审核]{elseif $v.httext == 2}[已邮寄]{elseif $v.httext ==
                      3}[已驳回]{else}[未邮寄]{/if}{/if}
                      {if !empty($v.openid)}<button type="button" class="layui-btn layui-btn-xs">已消息授权</button>{/if}
                    </div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.groups_text|default=""}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.mobile}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.remark}</div>
                  </td>

                  <td class="layui-table-col-special">
                    <div class="layui-table-cell">
                      <a title="恢复" onclick="open_dels(this,'/shop/recuser','{$v.id}')" href="javascript:;"
                        class="layui-btn-danger layui-btn layui-btn-sm">
                        恢复账号(恢复后再用户列表查看)
                      </a>
                    </div>
                  </td>
                </tr>
                {/foreach}
              </tbody>
            </table>
          </div>
          <div class="layui-card-body">
            <div class="page">{$list->render()|raw}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  {include file="public/footer"}
  <script>
    function tbsorts() {
      layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
          , layer = layui.layer;
        var sort = $('input[name="sorts"]').val();
        if (!sort || sort == 1) {
          $('input[name="sorts"]').val(2);
        } else {
          $('input[name="sorts"]').val(1);
        }
        form.render();
      });
      var currentUrl = location.href + '&sorts=' + $('input[name="sorts"]').val();
      location.href = currentUrl;
    }
    layui.use(['form', 'layer', 'laydate'], function () {
      $ = layui.jquery;
      var laydate = layui.laydate;
      var form = layui.form
        , layer = layui.layer;
      laydate.render({
        elem: '#dates' //指定元素
        , type: 'month'
      });
    });
  </script>
</body>